<?xml version="1.0" encoding="UTF-8" ?>
<%@page import="java.util.Calendar"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="org.jakim.entity.*"%>
<%@ page import="org.jakim.utils.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<fmt:setLocale value="bg" />
<fmt:setBundle basename="org.jakim.messages.messages" scope="session" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="js/DatePicker/scw.js"></script>
<script type="text/javascript"> 
function validateForm()
{
    var x=document.forms["formRegistration"]["userName"];
    if (x.value == null || x.value  == ""){
    	x.style.backgroundColor = "#FF0000 ";
        alert("First name must be filled out");
        return false;
    } return true;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<link href="js/DatePicker/datepick.css" rel="stylesheet" type="text/css" />
<link href="styles/registration.css" rel="stylesheet" type="text/css" />
<title>Insert title here</title>
</head>
<body>
	<div id="divHeaderContainer">
		<fmt:message key="REGISTRATION.WELCOME"></fmt:message>
	</div>
	<div id="divBodyContainer">
		<div id="divRegistrationContainer">
			<form id="formRegistration" name="formRegistration" method="post"
				action="register" onsubmit="validateForm()">

				<fieldset id="fsetRegistration">
					<legend>
						<fmt:message key="REGISTRATION.FORM.LABEL" />
						:
					</legend>

					<div>
						<label id="lblUserName" for="txtUserName"> <fmt:message
								key="REGISTRATION.FORM.USERNAME.LABEL" />:
						</label> <input type="text" name="userName" maxlength="15" />
					</div>

					<div>
						<label id="lblUserSirName" for="txtUserSirName"> <fmt:message
								key="REGISTRATION.FORM.USERSIRNAME.LABEL" />:
						</label> <input type="text" name="userSirName" id="txtUserSirName"
							maxlength="15" />
					</div>

					<div>
						<label id="lblUserEmail" for="txtUserEmail"> <fmt:message
								key="REGISTRATION.FORM.USEREMAIL.LABEL" />:
						</label> <input type="text" name="userEmail" id="txtUserEmail"
							maxlength="30" />
					</div>

					<div>
						<label id="lblUserPassword" for="txtUserPassword"> <fmt:message
								key="REGISTRATION.FORM.USERPASSWORD.LABEL" />:
						</label> <input type="password" name="userPassword" id="txtUserPassword"
							maxlength="30" />
					</div>

					<div>
						<label id="lblUserConfirmConfirmPassword"
							for="txtUserConfirmPassword"> <fmt:message
								key="REGISTRATION.FORM.USERCONFIRMPASSWORD.LABEL" />:
						</label> <input type="password" name="userConfirmPassword"
							id="txtUserConfirmPassword" maxlength="30" />
					</div>

					<div>
						<label id="lblUserCity" for="txtUserCity"> <fmt:message
								key="REGISTRATION.FORM.USERCITY.LABEL" />:
						</label> <input type="text" name="userCity" maxlength="15"
							id="txtUserCity" />
					</div>

					<div>
						<label id="lblUserCountry" for="txtUserCountry"> <fmt:message
								key="REGISTRATION.FORM.USERCOUNTRY.LABEL" />:
						</label> <input type="text" id="txtUserCountry" name="userCountry"
							maxlength="15" />
					</div>

					<div>
						<label id="lblUserBirthDate" for="txtUserBirthDate"> <fmt:message
								key="REGISTRATION.FORM.USERBIRTHDATE.LABEL" />:
						</label> <input id="date2" type="text" tabindex="130" value="feb,98" /> <img
							src="images/scw.gif" title="Click Here" alt="Click Here"
							onclick="scwShow(scwID('date2'),event,3);" /> <input type="text"
							onclick="scwShow(this,event);" id="txtUserBirthDate" /> <select
							name="userBirthDay">
							<%
                                    for (int i = 1; i < 32; i++){
                                        out.write("<option value='" + i + "'>" + i + "</option>"); 
                                    }
                                %>
						</select> <select name="userBirthMonth">
							<%
                                    for (Months month : Months.values()){
                                        out.write("<option value='" + month.getMonthNumber() + 
                                                  "'>" + month.getMonthName() +
                                                  "</option>"); 
                                    }
                                %>
						</select> <select name="userBirthYear">
							<%
                                    Calendar cal = Calendar.getInstance();
                                    int year = cal.get(Calendar.YEAR);
                                    for (int i = year; i >= 1900; i--){
                                        out.write("<option value='" + i + "'>" + i + "</option>"); 
                                    }
                                %>
						</select>
					</div>

					<div>
						<input type="submit"
							value="<fmt:message key='REGISTRATION.FORM.SUBMIT.LABEL' />" />
					</div>
				</fieldset>

			</form>
		</div>
		<!-- End of RegistraionContainer  -->
	</div>
	<!-- End of BodyContaner -->

	<div id="divFooterContainer"></div>
</body>
</html>